package base_grammar

import "fmt"

type Person5 struct {
	id   int
	name string
}

func showPerson(person Person5) {
	person.name = "kite"
	fmt.Printf("person: %v\n", person)
}

func showPerson2(person *Person5) {
	person.name = "kite"
	fmt.Printf("person: %v\n", person)
}

func struct_f5() {
	// 址传递
	person := Person5{1, "tom"}
	fmt.Printf("person: %v\n", person)
	fmt.Println("============")
	showPerson2(&person)
	fmt.Println("============")
	fmt.Printf("person: %v\n", person)
}

func struct_f4() {
	// 值传递
	person := Person5{1, "tom"}
	fmt.Printf("person: %v\n", person)
	fmt.Println("============")
	showPerson(person)
	fmt.Println("============")
	fmt.Printf("person: %v\n", person)
}
